<template>
	<view class="page income bgff p12">
		<view class="flex flexC flexB mb18">
			<view>累计金额:￥{{total}}</view>
		</view>
		<scroll-view class="shadow1 r10 py6 lis" scroll-y="true" @scrolltolower="nextPage">
			<view v-for="(item,index) in list" class="borb py14 mx12">
				<view class="flex flexB flexC">
					<view class="flex flexC">
						<image  class="w26 r50 bgf5 mr6" src="../../static/img/icon/union.png" mode="aspectFill"></image>
						
						<text>账号：{{item.bankNum}}</text>
					</view>
					<text>{{item.create_time_txt}}</text>
				</view>
				<view class="c66 fs12 my8"></view>
				<view class="flex flexB flexC fs12">
					<text class="c66">金额： {{item.amount}}</text>
					<text class="bold6 cff0">{{item.status}}</text>
				</view>
			</view>
		</scroll-view>
		
	
	</view>
</template>

<script>
	
	export default {
		data() {
			return {
				list:[],
				page:1,
				isLastPage:false,
				isnodata:false,
				total:0,
				dateText: '请选择日期',
				selectDate:""
			};
		},
		onLoad(option){
		
			this.getList();
		},
		
		onReachBottom(){

		},
		methods:{
			
			nextPage(){
				
				if(this.isLastPage) return;
				this.page += 1;
				this.getList();
			},
			
			// 打开日历
			openCalendar() {
				console.info(this.tabIndex);
				this.$refs.calendar.open();
				
			},
			// 确认选择日期
			confirm(ev) {
				let {
					before,
					after
				} = ev.range;
				var year = ev.year;
				var month = ev.month;
				var date = ev.date;
			
				var str = year + "-" + month + "-" + date;
			
				this.selectDate = year + "-" + month + "-" + date;
				this.dateText = this.selectDate;
				console.info(this.selectDate);
				this.page = 1;
				this.list = [];
				this.getList();
			
			},
			
			getList(){
				let param = {
					page:this.page,
					date:this.selectDate,
					type:'shop'
			
				}
				let that = this;
				this.$api.withDrawList(param).then(res => {
				
					if (res.code == 1) {
				
						let length = res.data.list.length;
						that.total = res.data.total;
						for (let i = 0; i < length; i++) {
							that.list.push(res.data.list[i]);
						}
						if(that.list.length>0){
							that.isnodata=false;
						}else{
							that.isnodata=true;
						}
						if (length < 10) {
							that.isLastPage = true;
						} else {
							that.isLastPage = false;
						}
						console.info(res);
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
.income {
	.lis {height: calc(100vh - 140upx);}
	.w26 {width: 52upx;height: 52upx;}
}
</style>
